package io.mya.modules.sys.service.impl;

import io.mya.common.utils.Query;
import io.mya.modules.sys.dao.TokenInfoDao;
import io.mya.modules.sys.entity.CandyTokenEntity;
import io.mya.modules.sys.entity.TokenInfoEntity;
import io.mya.modules.sys.service.TokenInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;

@Service("tokenInfoService")
public class TokenInfoServiceImpl implements TokenInfoService {
    @Autowired
    private TokenInfoDao tokenInfoDao;

    @Override
    public List<TokenInfoEntity> queryCandyTokenList() {
        return tokenInfoDao.queryCandyTokenList();
    }

    @Override
    public List<TokenInfoEntity> list(Query query) {
        return tokenInfoDao.queryList(query);
    }

    @Override
    public void save(TokenInfoEntity tokenInfo) {
        tokenInfoDao.save(tokenInfo);
    }
    @Override
    public void update(TokenInfoEntity tokenInfo) {
        tokenInfoDao.update(tokenInfo);
    }
    @Override
    public TokenInfoEntity queryObject(Long id) {
        return tokenInfoDao.queryObject(id);
    }

    @Override
    public void deleteBatch(Long id) {
        tokenInfoDao.delete(id);
    }

    @Override
    public void upstatus(Long id, String status) {
        HashMap<String, Object> map = new HashMap<>();
        map.put("id", id);
        map.put("status", status);
        tokenInfoDao.upstatus(map);
    }
}
